html>

<head>
  <script type="text/javascript">
    function getOptions() {
      var x = document.getElementById("mySelect");
      var y = "";
      for (i = 0; i < x.length; i++) {
        y += x.options[i].text;
        y += "<br />";
      }
      document.write(y);
    }
    
      window.onload = function () {
        var x = document.getElementById("mySelect");
        document.write(x.options[0].text);
      }
  </script>
  <script src="js/jquery-3.4.1.min.js"></script>
</head>

<body>

  <form>
    请选择您喜欢的水果：
    <select id="mySelect">
      <option>苹果</option>
      <option selected>桃子</option>
      <option>香蕉</option>
      <option>桔子</option>
    </select>
    <br /><br />
    <input type="button" onclick="getOptions()" value="输出所有选项">
  </form>
<script>
      $(function(){
        var timesRun = 0;
        var interval = setInterval(function () {
          console.log("test");
          timesRun += 1;
          if (timesRun === 10) {
            clearInterval(interval);
          }
          //do whatever here..
        }, 2000);
  })
</script>
</body>

</html>